package com.transaction.controller;

import com.transaction.service.BusinessService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BusinessController {

    private final BusinessService businessService;

    public BusinessController(BusinessService businessService) {
        this.businessService = businessService;
    }

    @GetMapping("/business/execute")
    public String execute() {
        try {
            businessService.doBusiness();
            return "Success";
        } catch (Exception e) {
            return "Failed: " + e.getMessage();
        }
    }
}